package com.laizhenghua.order.controller;

import com.laizhenghua.commons.entity.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.Map;

/**
 * @description:
 * @date: 2022/1/3 16:34
 */
@RestController
@RequestMapping(value = "/consumer")
public class OrderController {
    public static final String INVOKE_URL = "http://cloud-payment8003";

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping(value = "/getPaymentZk", method = RequestMethod.GET)
    public CommonResult<Map<String, Object>> getPaymentZkInfo() {
        return restTemplate.getForObject(INVOKE_URL + "/payment/zk", CommonResult.class);
    }
}
